<template>
  <div class="header">
    <div class="logo" @click="clickLogo">
      <img src="../assets/images/logo.jpg" alt="logo">
      <div class="text">
        <span>毛不易</span>
        博客系统
      </div>
    </div>
    <div class="nav">
<!--      <a href="#" class="active"></a>-->
      <router-link to="/show">博客列表</router-link>
      <router-link to="/add">添加博客</router-link>
<!--      <a href="#">添加博客</a>-->
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    clickLogo () {
      this.$router.push('/')
    }
  }
}
</script>

<style lang="less" scoped>
.header{
  height: 100px;
  background: #42b983;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .logo{
    display: flex;
    align-items: center;
    margin-left: 15px;
    cursor:pointer;
    img{
      width: 60px;
      border-radius: 10px;
    }
    .text{
      color: #fff;
      margin-left: 10px;
      font-size: 18px;
      span{
        display: block;
        opacity: .7;
        font-size: 14px;
      }
    }
  }
  .nav{
    a{
      color: white;
      padding: 10px 20px;
      margin-left: 10px;
      border-radius: 5px;
     margin-right: 20px;
      font-size: 20px;
      &:hover,&.active{
        background: #fff;
        color: #42b983;
      }
    }
  }
}
</style>
